<?php
session_start();
if (isset($_POST['fdes'])){
    $openid=$_POST['fdes'];
    $nianji=$_POST['nianji'];
     
    $dbhost = '47.110.131.55';
    $dbuser = 'root';
    $dbpwd  ='sxy7788123456';
    $dbName ='gu';
	$mysqli = new mysqli($dbhost, $dbuser, $dbpwd, $dbName);
	if (!$mysqli->set_charset("utf8")) {printf("Error loading character set utf8: %s\n", $mysqliTwo->error);}
 
	if (1 == $_SESSION['cishu']){
	    $cishu=1;
	}else{
	    $cishu=2;
	}
	
	$sql="select di,dati from da_log".$nianji." where openid='".$openid."' and skey='".$cishu."' limit 0, 1";
	$query=$mysqli->query($sql);
	if($query->num_rows>0){
	    $getLog=$query->fetch_assoc();
	    echo json_encode(array('s'=>'ok','d'=>$getLog['di'],'t'=>$getLog['dati']));
	}else{
	    echo json_encode(array('s'=>'no'));
	}
	$mysqli->close();
}


?>